package org.omg.IIOP;

//
// Helper class for : BiDirIIOPServiceContext
//
// @author OpenORB Compiler
//
public class BiDirIIOPServiceContextHelper
{

	//
	// Insert BiDirIIOPServiceContext into an any
	// @param	a an any
	// @param	t BiDirIIOPServiceContext value
	//
	public static void insert( org.omg.CORBA.Any a, org.omg.IIOP.BiDirIIOPServiceContext t )
	{
		a.insert_Streamable( new org.omg.IIOP.BiDirIIOPServiceContextHolder( t ));
	}

	//
	// Extract BiDirIIOPServiceContext from an any
	// @param	a an any
	// @return the extracted BiDirIIOPServiceContext value
	//
	public static org.omg.IIOP.BiDirIIOPServiceContext extract( org.omg.CORBA.Any a )
	{
		return read(a.create_input_stream());
	}

	//
	// Internal TypeCode value
	//
	private static org.omg.CORBA.TypeCode _tc = null;
	private static boolean _working = false;

	//
	// Return the BiDirIIOPServiceContext TypeCode
	// @return a TypeCode
	//
	public static org.omg.CORBA.TypeCode type()
	{
		if ( _tc == null ) {
			synchronized(org.omg.CORBA.TypeCode.class) {
				if ( _tc != null )
					return _tc;
				if ( _working )
					return org.omg.CORBA.ORB.init().create_recursive_tc( id() );
				_working = true;
				org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
				org.omg.CORBA.StructMember []_members = new org.omg.CORBA.StructMember[1];

				_members[0] = new org.omg.CORBA.StructMember();
				_members[0].name = "listen_points";
				_members[0].type = org.omg.IIOP.ListenPointListHelper.type();
				_tc = orb.create_struct_tc(id(),"BiDirIIOPServiceContext",_members);
				_working = false;
			}
		}
		return _tc;
	}

	//
	// Return the BiDirIIOPServiceContext IDL ID
	// @return an ID
	//
	public static String id()
	{
		return _id;
	}

	private final static String _id = "IDL:omg.org/IIOP/BiDirIIOPServiceContext:1.0";

	//
	// Read BiDirIIOPServiceContext from a marshalled stream
	// @param	istream the input stream
	// @return the readed BiDirIIOPServiceContext value
	//
	public static org.omg.IIOP.BiDirIIOPServiceContext read( org.omg.CORBA.portable.InputStream istream )
	{
		org.omg.IIOP.BiDirIIOPServiceContext new_one = new org.omg.IIOP.BiDirIIOPServiceContext();

		new_one.listen_points = org.omg.IIOP.ListenPointListHelper.read(istream);

		return new_one;
	}

	//
	// Write BiDirIIOPServiceContext into a marshalled stream
	// @param	ostream the output stream
	// @param	value BiDirIIOPServiceContext value
	//
	public static void write( org.omg.CORBA.portable.OutputStream ostream, org.omg.IIOP.BiDirIIOPServiceContext value )
	{
		org.omg.IIOP.ListenPointListHelper.write(ostream,value.listen_points);
	}

}
